<!--
 * @Author: 颜礼田 2564217790@qq.com
 * @Date: 2024-09-05 11:23:39
 * @LastEditors: MrDotYan 2564217790@qq.com
 * @LastEditTime: 2024-09-24 15:55:29
 * @FilePath: /EqDataProcessWeb/src/views/paramManage/geoelectricity/personnelConfiguration/components/Title.vue
-->
<template>
  <div class="title">
    <div class="title-container">
      <!-- 原本设计为点或者竖线 -->
      <div :class="`title-${type}`"></div>
      <slot name="title">
        <div class="title-text">
          <span>{{ title }}</span>
        </div>
      </slot>
    </div>
    <slot name="extra">
      <div class="title-extra">
        <span>{{ extraText }}</span>
      </div>
    </slot>
  </div>
</template>

<script lang="ts" setup>
export interface TitleProps {
  type?: "line" | "dot";
  title: string;
  extraText?: string;
}

withDefaults(defineProps<TitleProps>(), {
  type: "dot"
});
</script>

<style lang="scss" scoped>
.title {
  display: flex;
  &-container {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-start;
  }
  &-line {
    width: 4px;
    height: 18px;
    margin-right: 8px;
    background-color: var(--el-color-primary);
  }
  &-dot {
    width: 10px;
    height: 10px;
    margin-right: 8px;
    background-color: var(--el-color-primary);
    border-radius: 50%;
  }
  &-text {
    // font-size: 18px;
    font-weight: 700;
  }
}
</style>
